package info.empathymobile.forecast.util;

import android.os.Build;

public class DeviceInfo {
	public static String getDeviceName() {
	  String manufacturer = Build.MANUFACTURER;
	  String model = Build.MODEL;
	  if (model.startsWith(manufacturer)) {
	    return capitalize(model);
	  } else {
	    return capitalize(manufacturer) + " " + model;
	  }
	}
	
	public static int getDeviceSOVersionNumber(){
		return Build.VERSION.SDK_INT;
	}

	private static String capitalize(String s) {
	  if (s == null || s.length() == 0) {
	    return "";
	  }
	  char first = s.charAt(0);
	  if (Character.isUpperCase(first)) {
	    return s;
	  } else {
	    return Character.toUpperCase(first) + s.substring(1);
	  }
	}
}
